package com.klun.designMode.decorator;

public class Client {
    public static void main(String[] args) {

        ICar car = new Car();
        car.move();
        System.out.println("*****增加新的功能：飞行");
        ICar flycar = new FlyCar(car);
        flycar.move();

        System.out.println("*****增加新的功能：水里游");
        ICar waterCar = new WaterCar(car);
        waterCar.move();

        System.out.println("*****增加两个新的功能，飞行，水里游");
        ICar waterCar2 = new WaterCar(flycar);
        waterCar2.move();

        System.out.println("*****累加3个新的功能，飞行，水里游，自动驾驶");
        ICar superCar = new AICar(waterCar2);
        superCar.move();
    }
}
